package com.hua.store.domin;

//购物项目的抽取
public class CartItem {
    private Product product;
    private int num;//购买num件商品
    private double subTotal;//商品小计

    public CartItem() {
    }

    public CartItem(Product product, int num, double subTotal) {
        this.product = product;
        this.num = num;
        this.subTotal = subTotal;
    }

    public Product getProduct() {
        return product;
    }

    public void setProduct(Product product) {
        this.product = product;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public double getSubTotal() {
        return product.getShop_price() * num;
    }

    public void setSubTotal(double subTotal) {
        this.subTotal = subTotal;
    }
}
